package org.jeecg.modules.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.system.entity.SysDictItem;

import java.util.List;
import java.util.Map;

/**
 * @author lixingxing
 */
public interface SysDictItemMapper extends BaseMapper<SysDictItem> {
    /**
     * selectItemsByMainId
     *
     * @param mainId
     * @return java.util.List<org.jeecg.modules.system.entity.SysDictItem>
     */
    @Select("SELECT * FROM sys_dict_item WHERE DICT_ID = #{mainId} order by sort_order asc, item_value asc")
    List<SysDictItem> selectItemsByMainId(String mainId);

    /**
     * selectTableField
     *
     * @param table
     * @param field
     * @param key
     * @param value
     * @return java.lang.String
     */
    String selectTableField(@Param("table") String table, @Param("field") String field, @Param("key") String key, @Param("value") String value);

    /**
     * selectTableFieldMultiple
     *
     * @param table
     * @param field
     * @param key
     * @param value
     * @return java.util.List<java.lang.String>
     */
    List<String> selectTableFieldMultiple(@Param("table") String table, @Param("field") String field, @Param("key") String key, @Param("value") String[] value);

    /**
     * selectTable
     *
     * @param table
     * @param field
     * @param key
     * @param value
     * @return java.util.Map<java.lang.String, java.lang.Object>
     */
    Map<String, Object> selectTable(@Param("table") String table, @Param("field") String field, @Param("key") String key, @Param("value") String value);
}
